package main

import "fmt"

type Humaner interface {
	SayHi()
}

type Personer interface {
	Humaner
	Sing(lrc string)
}

type Student struct {
	name string
	score float64
}
//Student实现Sing()方法
func (s *Student) Sing(lrc string) {
	fmt.Printf("Student sing [%s]!!\n", lrc)
}

func (s *Student) SayHi() {
	fmt.Printf("Student[%s, %f] say hi!!\n", s.name, s.score)
}

func main() {
	//超集可以转换为子集,子集不可转换为超集
	//var i1 Humaner = &Student{"mike", 99}
	//var i2 Personer = i1

	//Personer为超集,Human为子集
	var i1 Personer = &Student{"Mike", 98}
	var i2 Humaner = i1
	i2.SayHi()

}
